<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" />
    <title>押品搜索</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>押品搜索</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                押品搜索
            </h2>
        </div>
    </div>
</div>
<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" controller="vehicleImport" action="searchImport"    class="form-horizontal" role="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                     <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i>重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group">
                     <div class="form-group col-md-4">
                        <label class="col-md-3 control-label">抵押物品牌</label>
                        <div class="col-md-9">
                            <input type="text" class="form-control"  id="brand" name="brand" value="${params?.brand}" placeholder="请输入抵押物品牌">
                        </div>
                     </div>
                     <div class="form-group col-md-4">
                            <label class="col-sm-3 control-label">评估状态</label>
                            <div class="col-sm-9">
                                <g:select  class="form-control m-b"  name="evaluateStatue" from="${com.cindata.dictionary.ExecStatusDict.list()}" id="evaluateStatue"  optionKey="id"
                                 optionValue="name"   value="${params?.evaluateStatue}" noSelection="${['':'请选择评估状态']}"></g:select>
                             </div>
                    </div>
                    <div class="form-group col-md-4">
                        <label class="col-md-3 control-label">押品状态</label>
                        <div class="col-md-9">
                            <g:select  class="form-control m-b"  name="estateStatus" from="${com.cindata.dictionary.EstateStatusDict.list()}" id="status"  optionKey="id"
                                       optionValue="name"   value="${params?.estateStatus}" noSelection="${['':'请选择押品状态']}"></g:select>
                        </div>
                    </div>
                    <div class="col-sm-9" style="display: none">
                        <input type="text" class="form-control"  id="id" name="id" value="${params?.id}">
                    </div>
                </div>
        </g:form>
    </div>


    %{--</div>--}%
        <div class="row">
            <div class="hpanel hgreen">
                <div class="panel-heading">
                    全部押品
                </div>
                <div class="panel-body no-padding">
                    <div class="table-responsive">
                        <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                            <thead>
                            <tr>
                                <g:sortableColumn property="id" title="押品编号"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="city.name" title="城市名称"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="district.name" title="行政区名称"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="estateStatus.name" title="评估状态"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="estateStatus.name" title="押品状态"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="vehicleTypeDict.name" title="交通运输工具类型"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="plateNumber" title="车牌号"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="isNew" title="是否新车"  class="col-md-1 text-center"params="${params}"/>
                                <g:sortableColumn property="brand" title="品牌"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="model" title="车辆型号"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="purchasePrice" title="购置价格"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="currency" title="币种"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="purchaseDate" title="购置日期"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="usage" title="使用情况"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="totalPrice" title="评估总价（元）"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="account" title="受理网点"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="fullName" title="抵押人名称"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="registerFullName" title="登记人"  class="col-md-1 text-center" params="${params}"/>
                                <g:sortableColumn property="registerAccount" title="登记机构"  class="col-md-1 text-center" params="${params}"/>

                            </tr>
                            </thead>
                            <tbody>
                            <g:each in="${vehicleImportList}">
                                <tr class="text-center">
                                    <td >${it?.externalId}</td>
                                    <td >${it?.city?.name}</td>
                                    <td >${it?.district?.name}</td>
                                    <td>
                                        <g:if test="${it?.evaluateStatue?.name == '失败'}">
                                            <a href="javascript:void(0)" name="state" reason="${it?.failReason}">${it?.evaluateStatue?.name}</a>
                                        </g:if>
                                        <g:else>
                                            ${it?.evaluateStatue?.name}
                                        </g:else>
                                    </td>
                                    <td>${it?.estateStatus?.name}</td>
                                    <td>${it?.type?.name}</td>
                                    <td>${it?.plateNumber}</td>
                                    <td>${it?.isNew?'是':'否'}</td>
                                    <td>${it?.brand}</td>
                                    <td>${it?.model}</td>
                                    <td>${it?.purchasePrice}</td>
                                    <td>${it?.currency?.name}</td>
                                    <td><g:formatDate date="${it?.purchaseDate}" format="yyyy-MM-dd "></g:formatDate></td>
                                    <td>${it?.usage}</td>
                                    <td>${it?.totalPrice}</td>
                                    <td>${it?.account?.name}</td>
                                    <td>${it?.fullName}</td>
                                    <td>${it?.registerFullName}</td>
                                    <td>${it?.registerAccount}</td>
                                </tr>
                            </g:each>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="panel-footer">
                    <div class="pagination">
                        <g:paginate total="${vehicleImportCount ?: 0}" params="${params}"/>
                    </div>
                </div>
            </div>
        </div>
    %{--</div>--}%
    <g:javascript>
        $(function () {
            //重置按钮
            $("#resetBtn").click(function () {
                $("#address").val("");
                $("#s2id_status span:first").html("请选择押品状态");
                $("#status").val("");
            })
            //导入弹出
            /*$('table').find('tbody').find('tr').on('click', function() {
             window.location.href("sdfg.jsp")
             })*/
            $("a[name='state']").click(function(){
                var reason = $(this).attr("reason");
                swal({
                    title: "失败原因",
                    text: reason,
                    type: "error"
                });
            });
        })

        //日期控件调用
        /*$('#datepicker').datepicker({
         language: 'zh-CN'
         });*/
        //上传文件按钮
        /* $(".myFileUpload").change(function () {
         var arrs = $(this).val().split('\\');
         var filename = arrs[arrs.length - 1];
         $(".show").html(filename);
         });*/

    </g:javascript>

</body>
</html>
